﻿using System;
using fastCSharp;

namespace diantou.web.exam
{
    /// <summary>
    /// 用户设置
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsPage = false)]
    partial class setting : view<setting>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private bool loadView(int examId)
        {
            if (user != null && examUser.ExamId == examId)
            {
                if (!examUser.IsRegister) return load(examId);
                if (examUser.ExamTime != fastCSharp.pub.MinTime && !examUser.IsSubmit && examUser.SubmitTime > date.NowSecond)
                {
                    location(new diantou.dataModel.path.exam { Id = examId }.Problem);
                }
                else location(new diantou.dataModel.path.exam { Id = examId }.Description);
                return false;
            }
            if (load(examId))
            {
                switch (exam.Type)
                {
                    case dataModel.exam.type.考生熟悉环境的测试赛:
                    case dataModel.exam.type.完成答卷后发简历的考试:
                    case dataModel.exam.type.预先注册的考试:
                        location(exam.Path.Register);
                        return false;
                }
                location(exam.Path.Index);
            }
            return false;
        }
    }
}
